import java.awt.event.*;
import java.io.*;
import java.lang.reflect.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;

/**
 * Tries to do the repeat thing.
 */
class Repeat extends LocalServer {

  /** Shows a pop up of the messsage. */
  private class CheckHandler extends AbstractHandler {

    private boolean state = true;

    public String handle(Map<String,String> args) {
      boolean respond = state;
      state = !state;
      note("respond:"+respond);
      return respond ? "OK" : Server.DONT_RESPOND;
    }

    CheckHandler() {
      super("Check");
    }
  }

  Handler[] getHandlers() {
    return new Handler[] {
      new CheckHandler()
    };
  }

  public static void main(String args[]) {
    new Repeat().realMain(args);
  }
  
}
